home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / programmers / source / checkaga / checkaga.e next >
Text File  |  1978-06-29  |  2KB  |  61 lines

  1. /*----------------------------------------------------------------------------*
  2.  
  3.   EMODULES:other/checkaga
  4.  
  5.     NAME
  6.       checkaga -- checks if the aga-chipset is present
  7.  
  8.     SYNOPSIS
  9.       bool:=checkaga()
  10.  
  11.     FUNCTION
  12.       ``Future Amigas will *NOT* support *ANY* of the new AGA registers.
  13.       If you want your product to work on the next generation of Amigas
  14.       then detect aga before of run, and if is not present exit or use
  15.       ECS, that will be supported as emulation in the new C= low-end
  16.       and high-end machines.  That machines will have probably a
  17.       totally new ChipSet, without any $dffXXX register, and probably
  18.       not bitplane system.
  19.  
  20.       Even the processor isn't necessarily final.  It is strongly
  21.       rumoured that the Motorola MC68060 is the final member of the
  22.       68000 series, and may not even come out.  Expect Amigas in 2-3
  23.       years to come with RISC chip processors running 680x0 emulation.
  24.  
  25.       This is my AGA detect routine 101%...  (thanx to DDT/HBT for the
  26.       last 1%) It will detect AGA on the future updated AGA machines.
  27.       Instead making a CMPI.B #$f8,$dff07c on that new AGA machines
  28.       only old chipset will be detected!!!!''
  29.  
  30.                `The AGA doc (V2.5) for AGA CODERS' by RANDY of COMAX
  31.  
  32.     INPUTS
  33.       None
  34.  
  35.     RESULT
  36.       Returns TRUE if the AGA-chipset is present. Returns FALSE
  37.       if the AGA-chipset is not present
  38.  
  39.  *----------------------------------------------------------------------------*/
  40.  
  41. OPT MODULE
  42. OPT REG=5
  43.  
  44. EXPORT PROC checkaga()
  45.     LEA     $DFF000,A3
  46.     MOVE.W  $7C(A3),D0              ;-> DeniseID or LisaID in AGA
  47.     MOVEQ   #30,D2                  ;-> Check 30 times ( prevents old denise random)
  48.     ANDI.W  #%000000011111111,D0    ;-> low byte only
  49. denloop:
  50.     MOVE.W  $7C(A3),D1              ;-> Denise ID (LisaID on AGA)
  51.     ANDI.W  #%000000011111111,D1    ;-> low byte only
  52.     CMP.B   D0,D1                   ;-> same value?
  53.     BNE.S   notaga                  ;-> Not the same value, then OCS Denise!
  54.     DBRA    D2,denloop              ;-> (THANX TO DDT/HBT FOR MULTICHECK HINT)
  55.     ORI.B   #%11110000,D0           ;-> MASK AGA REVISION (will work on new aga)
  56.     CMPI.B  #%11111000,D0           ;-> BIT 3=AGA (this bit will be=0 in AAA!)
  57.     BNE.S   notaga                  ;-> IS THE AGA CHIPSET PRESENT?
  58.     RETURN  TRUE                    ;-> AGA -> Return TRUE
  59. notaga:                             ;-> NOT AGA, BUT IS POSSIBLE AN AAA MACHINE!!
  60. ENDPROC FALSE
  61.